package cn.itcast.bos.service.subarea.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.AreaRepository;
import cn.itcast.bos.dao.FixedAreaRepository;
import cn.itcast.bos.dao.SubAreaRepository;
import cn.itcast.bos.domain.base.Area;
import cn.itcast.bos.domain.base.FixedArea;
import cn.itcast.bos.domain.base.SubArea;
import cn.itcast.bos.service.subarea.SubAreaService;

@Service
@Transactional
public class SubAreaServiceImp implements SubAreaService {
	@Autowired
	private SubAreaRepository subAreaRepository;
	@Autowired
	private FixedAreaRepository fixedAreaRepository;
	@Autowired
	private AreaRepository areaRepository;

	public void saveBath(List<SubArea> list) {
		subAreaRepository.save(list);		

	}

	public FixedArea findFixedAreaById(String stringCellValue) {

		return fixedAreaRepository.findOne(stringCellValue);
	}

	public Area findAreaById(String stringCellValue) {
		
		return areaRepository.findOne(stringCellValue);
	}

}
